import java.math.BigInteger;

class P324PreCalc {

	public static void main(String[] args) {
		for (int k = 1; k <= 366; k++) {
			process(k);
		}
	}

	private static void process(int i) {
		String fat = fat(i);
		int[] counter = new int[10];
		for (int k = 0; k < fat.length(); k++) {
			counter[Integer.parseInt(fat.charAt(k) + "")]++;
		}
		System.out.print("int[] array"+i+"={" + counter[0]);
		for (int k = 1; k < 10; k++) {
			System.out.print(","+counter[k]);
		}
		System.out.println("};");
		
		System.out.println("array["+i+"]=array"+i+";");
	}

	private static String fat(int i) {
		BigInteger fat = new BigInteger("1");
		for (int k = 1; k <= i; k++) {
			fat = fat.multiply(new BigInteger(""+k));
		}
		return fat.toString();
	}

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}

}
